<template>
	<view class="tabbar-page">
		<view class="tabbarbox">
			<view :class="['bariconbox',isActive=='home'?'barselect':'']" @click="handleToHome()">
				<image v-if="isActive=='home'" class="tabbar-icon select" src="@/static/nimg/home_sel.png" mode=""></image>
				<image v-else class="tabbar-icon" src="@/static/nimg/home.png" mode=""></image>
				<span >首页</span>
			</view>
			<view :class="['bariconbox',isActive=='my'?'barselect':'']" @click="handleToMy()">
				<image v-if="isActive=='my'" class="tabbar-icon select" :style="isActive=='my'?'width:50rpx':''" src="@/static/nimg/my_sel.png" mode=""></image>
				<image v-else class="tabbar-icon" src="@/static/nimg/my.png" mode=""></image>
				<span >我的</span>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			selectIndex:{
				type:String,
				default:"my"
			}
		},
		computed:{
			isActive(){
				return this.selectIndex
			}
		},
		methods: {
			handleToHome(){
				uni.redirectTo({
					url:'/pages/index/index'
				})
			},
			handleToMy(){
				uni.redirectTo({
					url:'/pages/userCenter/userCenter'
				})
			}
		}
	}
</script>

<style>
.tabbar-page{
	position: fixed;
	z-index: 99;
	width: 92%;
	height: 98rpx;
	background-color: #2e996c;
	box-shadow: 0rpx 17rpx 15rpx 3rpx rgba(10, 91, 25, 0.46);
	border-radius: 50rpx;
	bottom: 80rpx;
	left: 0;
	right: 0;
	margin: 0 auto;
}
.tabbarbox{
	display: flex;
	height: 100%;
	justify-content: space-around;
	align-items: center;
	border-radius: 50rpx;
}
.bariconbox{
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: #4AB688;
	width: 100rpx;
}
.barselect{
	color: black;
	margin-bottom: 30rpx;
}
.tabbar-icon{
	height: 40rpx;
	width: 40rpx;
}
.select{
	width: 70rpx;
	height: 70rpx;
}
</style>
